setNavigationIcon

Set the icon to use for the toolbar's navigation button.

The navigation button appears at the start of the toolbar if present. Setting an icon will make the navigation button visible.

If you use a navigation icon you should also set a description for its action using setNavigationContentDescription. This is used for accessibility and tooltips.

Parameters

resId

Resource ID of a drawable to set navigationIcon


open fun setNavigationIcon(@Nullable icon: @Nullable Drawable)(source)

Set the icon to use for the toolbar's navigation button.

The navigation button appears at the start of the toolbar if present. Setting an icon will make the navigation button visible.

If you use a navigation icon you should also set a description for its action using setNavigationContentDescription. This is used for accessibility and tooltips.

Parameters

icon

Drawable to set, may be null to clear the icon navigationIcon